<!DOCTYPE html>
<html>
	<head>
		<title><?php echo fw::config('title'); ?></title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
		<?php foreach(Template::$meta as $key=>$value): ?>
		<meta http-equiv="<?php echo $key; ?>" content="<?php echo $value; ?>"/>
		<?php endforeach; ?>
		<link rel="shortcut icon" href="<?php echo WEB; ?>style/<?php echo fw::config('style'); ?>/image/favicon.png"/>
		<?php if($this->controller == 'Manager'): ?>
		<link rel="stylesheet" href="<?php echo WEB; ?>fw/css/manager.css"/>
		<?php else: ?>
		<link rel="stylesheet" href="<?php echo WEB; ?>style/<?php echo fw::config('style'); ?>/main.css"/>
		<?php endif; ?>
		<?php if(Template::$vars): ?>
		<script type="text/javascript">
		<?php foreach(Template::$vars as $key=>$value): ?>
		var <?php echo $key; ?> = <?php echo json_encode($value); ?>;
		<?php endforeach; ?>
		</script>
		<?php endif; ?>
		<?php foreach(Template::$scripts as $file): ?>
		<script type="text/javascript" src="<?php echo $file; ?>"></script>
		<?php endforeach; ?>
		<?php if(Template::$code): ?>
		<script type="text/javascript">
		$(function()
		{
			<?php echo Template::$code; ?>
		});
		</script>
		<?php endif ;?>
	</head>
	<body>
		<?php require Template::child(); ?>
	</body>
</html>